<?php
namespace App\Http\Service\Agent;


use App\Http\Service\Basic\BasicService;
use Config;

class AgentService extends BasicService
{

    //构造函数
    function __construct()
    {
        parent::__construct();
    }


    //一级代理列表
    public function getAgentList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    //二级代理列表
    public function getSecAgentList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_sec_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    // 批量添加
    public function doAgentUpdate($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_update'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_update'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    /**
     * @param $where
     * @return bool|mixed|string
     * 代理账户充值
     */
    public function doAgentRecharge($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.Agent_recharge'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_recharge'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    /**
     * 代理信息删除
     */
    public function doAgentDelete($where)
    {
//                dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.Agent_delete'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_del'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }


    //添加代理
    public function doAgentAdd($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }

    //获取邀请码
    public function getFcode($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.agent_account_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_fcode'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }


}